package org.aeon.colorfulplanebattle.flying.entity;

import org.aeon.colorfulplanebattle.constant.ColorE;
import org.aeon.colorfulplanebattle.constant.DirectionE;

import java.awt.*;
import java.util.UUID;

/**
 * @author: MissingAeon
 * @date: 2024/1/9 12:26
 * @description:
 */
public abstract class FlyObject {
    protected UUID flyObjectId;             // 唯一id
    protected int x, y;                     // 坐标
    protected int width, height;            // 大小
    protected int touchWidth, touchHeight;  // 判定大小
    protected int camp;                     // 阵营
    protected String color;                  // 颜色
    protected int speed;                    // 速度
    protected boolean isDestroy;            // 已经摧毁

    public FlyObject() {
        this.flyObjectId = UUID.randomUUID();
        color = ColorE.BLUE.name();
    }

    /**
     * 玩家不会移动失败
     * 当敌方飞机移动出边缘后返回 false
     *
     * @param direction 方向
     * @return
     */
    public abstract boolean move(DirectionE direction);

    // 绘制
    public abstract void draw(Graphics g);

    public int getCamp() {
        return camp;
    }

    public void setCamp(int camp) {
        this.camp = camp;
    }

    public UUID getFlyObjectId() {
        return flyObjectId;
    }

    public int getX() {
        return x;
    }

    public void setX(int x) {
        this.x = x;
    }

    public int getY() {
        return y;
    }

    public void setY(int y) {
        this.y = y;
    }

    public int getWidth() {
        return width;
    }

    public void setWidth(int width) {
        this.width = width;
    }

    public int getHeight() {
        return height;
    }

    public void setHeight(int height) {
        this.height = height;
    }

    public int getSpeed() {
        return speed;
    }

    public void setSpeed(int speed) {
        this.speed = speed;
    }

    public boolean isDestroy() {
        return isDestroy;
    }

    public void setDestroy(boolean destroy) {
        isDestroy = destroy;
    }

    public int getTouchWidth() {
        return touchWidth;
    }

    public void setTouchWidth(int touchWidth) {
        this.touchWidth = touchWidth;
    }

    public int getTouchHeight() {
        return touchHeight;
    }

    public void setTouchHeight(int touchHeight) {
        this.touchHeight = touchHeight;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }
}
